Repository navigation
Conversation
…ndents, ask early with a default, and prove their tests fail without the change The plan's decision gains a habits object, and the worker holds a run to it in code. Before code: a bug's plan names the test that fails on the code as it is (or why none can, and the next best proof), and that test's task is moved to the top of the checklist. The worker reads the commits of the files the plan modifies and what depends on them (the code graph, and a search of the team's other repositories for each name the plan says it changes); a revert must be answered by name, and every dependent is updated by a task or called safe with the reason. A doubt that changes what gets built is asked at planning time with the default the run builds. After the build: each new or changed test file runs in the sandbox on the branch and on the base with only the tests added. A test that passes either way, a bug's test that cannot build on the base, a changed file outside the plan with no reason, and a planned dependent left untouched go back to the coder. The pull request carries the failing and passing result, the history and who the change affects. The check asks once for a step of its own when its sandbox runs would not fit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A run now does what a careful engineer does before and while writing code, and the worker checks each habit in code instead of trusting a prompt.
Splitting one large change into several pull requests is not in this change. A run owns one branch and one pull request per repository today, so splitting is a change to the run model and is left for a change of its own.
Changes
New modules in
services/worker/src/passes/:habits.rs: thehabitsobject of the plan's decision (repro,area_history,surfaces,no_outside_use,affected,ask_early), read loosely so a malformed habit never costs the plan its decision.Reader::factsreads the planned files' commits (commits_for_path, up to 8 files) and their dependents (Graph::impacted_by, plus a code search of up to 8 other repositories for up to 6 declared names).plan_gapsturns what is missing into send-back lines that carry those facts.keep_openkeeps what is still open after the one send-back on the decision and lists an unaccounted use in another repository among those affected, marked as not checked.put_repro_first,fold_questions,design_sectionandplanner_guidancedo the rest.habits_check.rs: the check on the open pull request.SandboxBenchruns each changed test file as its own step on the branch head and on a temporary branch holding the base plus the test files, side by side.verdictreads the two exit codes and the failing output (a filter that matched no tests is never read as a pass or a failure).outside_plan,not_updated,blocking,fix_feedback,open_findingsandsectionproduce the fix round, the Open items and the description's section. The check keeps its rounds and result in the run's ledger like the other checks, and asks once for a step of its own when the sandbox runs would not fit in the time left.incidents/ah_coder_habits.rsand a row indocs/incidents.md.Shared files touched, each minimally:
fix_location.rs: one field onFixDecision(habits) and the planner guidance gains the habits section.plan.rs: the facts are read for the draft and their gaps join the existing single send-back; after it, leftovers are kept, the reproducing test is moved first and design.md gains the section; early questions are folded into the decision's questions where the plan is parsed.PLANNER_VERSIONis bumped so cached plans are not reused.mod.rs: two module lines; the check is called after the new-feature rules in the single-repository pipeline (with a hand-off at the checks when it needs a step) and in the per-repository path of a run that spans repositories.pr.rs: one field onProof(habits) and one call inwith_checksthat places the section.run_guard.rs: the ledger gains the check's record, its last result and whether it has asked for a step.Not touched:
run_checksinimplement.rs, the open-items rendering,completeness.rs,proof.rs.Verification
cargo fmt --check --all: clean.cargo clippy --workspace --all-targets -- -D warnings: clean.cargo test --workspace: all pass (common 2088, gateway 902, worker 1643), including the 28 new tests (13 inhabits, 11 inhabits_check, 4 inincidents::ah_coder_habits).test_bug::Runner::run_atand the temporary-branch methodtest_bug::unit_before_afteralready uses.